// Translations for the application
export const translations = {
  en: {
    // Header
    apiKey: "API Key",
    privateRepos: "Private Repos",
    github: "GitHub",
    
    // Language toggle
    language: "Language",
    
    // Other common translations
    submit: "Submit",
    cancel: "Cancel",
    close: "Close",
    clear: "Clear",
    save: "Save Key",
    saveToken: "Save Token",
    
    // API key dialog
    apiKeyTitle: "Add your API Key",
    apiKeyDescription: "Enter your API key for custom diagrams.",
    apiKeyPlaceholder: "Enter your API key",
    selectModel: "Select Model",
    modelOpenAI: "OpenAI ",
    modelOpenAIO1: "OpenAI o1-mini",
    modelDeepSeek: "DeepSeek",
    getOpenAIKey: "Get your OpenAI API key",
    getDeepSeekKey: "Get your DeepSeek API key",
    apiDataStorageInfo: "Your API key will be stored locally in your browser and used only for generating diagrams. You can also self-host this app by following the instructions in the",
    
    // Private repos dialog
    privateReposTitle: "Enter GitHub Personal Access Token",
    privateReposDescription: "To enable private repositories, you'll need to provide a GitHub Personal Access Token with repo scope. The token will be stored locally in your browser.",
    privateReposPlaceholder: "ghp_...",
    howToGetPAT: "Find out how",
    dataStorageDisclaimer: "Data storage disclaimer",
    dataStorageInfo: "Take note that the diagram data will be stored in my database (not that I would use it for anything anyways). You can also self-host this app by following the instructions in the",
    readmeLink: "README",
    here: "here",
    
    // Main card/hero section
    heroTitle: "Quickly and deeply understand a project with CodeMariner",
    heroSubtitle: "Generate documents or diagrams",
    repoUrlPlaceholder: "Enter GitHub URL",
    generateButton: "Generate",
    introText: "Turn any GitHub repository into an interactive diagram for visualization.",
    usageHint: "You can also replace 'hub' with 'mariner' in any Github URL",
    usefulness: "Or have a conversation after generating documents and diagrams",
    
    // Examples section
    examplesTitle: "Or try an example:",
    
    // Diagram customization
    customizeButton: "Customize Diagram",
    exportButton: "Export Diagram",
    enableZoom: "Enable Zoom",
    downloadPng: "Download PNG",
    copyCode: "Copy Code",
    lastGenerated: "Last generated:",
    
    // Output type selection
    outputTypeTitle: "Select Output Type:",
    diagramOption: "Generate Diagram",
    documentOption: "Generate Documentation",
    overviewDocOption: "Overview Documentation",
    detailedDocOption: "Detailed Documentation",
    databaseDocOption: "Database Documentation",
    apiDocOption: "API Documentation",
    deploymentDocOption: "Deployment Documentation",
    
    // Document view
    modify: "Modify Document",
    export: "Export Markdown",
    copy: "Copy Text",
    modifyDocumentPlaceholder: "Enter instructions to modify the document...",
    documentLoading: "Generating detailed documentation...",
    
    // AI Chat
    ai_chat: "AI Chat",
    ask_about_repo: "Ask about this repository...",
    ask_about_code: "Ask about this code...",
    ask_about_document: "Ask about this document...",
    
    // Directory Viewer
    directory_browser: "Directory Browser",
    empty_directory: "Empty Directory"
  },
  zh: {
    // Header
    apiKey: "API 密钥",
    privateRepos: "私有仓库",
    github: "GitHub",
    
    // Language toggle
    language: "语言",
    
    // Other common translations
    submit: "提交",
    cancel: "取消",
    close: "关闭",
    clear: "清除",
    save: "保存密钥",
    saveToken: "保存令牌",
    
    // API key dialog
    apiKeyTitle: "添加您的 API 密钥",
    apiKeyDescription: "输入您的 API 密钥以获取自定义图表。",
    apiKeyPlaceholder: "输入您的 API 密钥",
    selectModel: "选择模型",
    modelOpenAI: "OpenAI ",
    modelOpenAIO1: "OpenAI o1-mini",
    modelDeepSeek: "DeepSeek",
    getOpenAIKey: "获取您的 OpenAI API 密钥",
    getDeepSeekKey: "获取您的 DeepSeek API 密钥",
    apiDataStorageInfo: "您的 API 密钥将存储在浏览器本地，仅用于生成图表。您也可以按照以下说明自行托管此应用",
    
    // Private repos dialog
    privateReposTitle: "输入 GitHub 个人访问令牌",
    privateReposDescription: "要启用私有仓库，您需要提供具有 repo 权限的 GitHub 个人访问令牌。该令牌将存储在您的浏览器本地。",
    privateReposPlaceholder: "ghp_...",
    howToGetPAT: "了解如何获取",
    dataStorageDisclaimer: "数据存储声明",
    dataStorageInfo: "请注意，图表数据将存储在我的数据库中（不过我不会将其用于任何其他用途）。您也可以按照以下说明自行托管此应用",
    readmeLink: "README",
    here: "这里",
    
    // Main card/hero section
    heroTitle: "码海星航 - 快速深入理解一个项目",
    heroSubtitle: "生成文档或者是图表",
    repoUrlPlaceholder: "输入 GitHub 网址",
    generateButton: "生成",
    introText: "将任何 GitHub 仓库转换为可视化的交互式图表或者各式各样的详细文档",
    usageHint: "您还可以在任何 Github URL 中用 'mariner' 替换 'hub'",
    usefulness: "或者生成文档和图表之后进行对话",
    
    // Examples section
    examplesTitle: "或者尝试示例:",
    
    // Diagram customization
    customizeButton: "自定义图表",
    exportButton: "导出图表",
    enableZoom: "启用缩放",
    downloadPng: "下载 PNG",
    copyCode: "复制代码",
    lastGenerated: "上次生成:",
    
    // Output type selection
    outputTypeTitle: "选择输出类型:",
    diagramOption: "生成图表",
    documentOption: "生成文档",
    overviewDocOption: "概述文档",
    detailedDocOption: "详细设计文档",
    databaseDocOption: "数据库文档",
    apiDocOption: "API接口文档",
    deploymentDocOption: "部署方案文档",
    
    // Document view
    modify: "修改文档",
    export: "导出 Markdown",
    copy: "复制文本",
    modifyDocumentPlaceholder: "输入修改文档的指令...",
    documentLoading: "正在生成详细文档...",
    
    // AI聊天
    ai_chat: "AI 对话",
    ask_about_repo: "询问关于这个仓库的问题...",
    ask_about_code: "询问关于这段代码的问题...",
    ask_about_document: "询问关于这篇文档的问题...",
    
    // 目录浏览器
    directory_browser: "目录浏览器",
    empty_directory: "空目录"
  }
};

// Type for available languages
export type Language = keyof typeof translations;

// Type for translation keys
export type TranslationKey = keyof typeof translations.en;

// 使用en对象类型作为locale类型
export type LocaleType = typeof translations.en;
export type LocaleKey = keyof LocaleType;

// 获取当前语言
export function getCurrentLanguage(): string {
  if (typeof window !== 'undefined') {
    return localStorage.getItem('language') || 'en';
  }
  return 'en';
} 